home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 March / Disc 1 / PCU030201.iso / software / apps / files / ftptrees.exe / DISK1 / _SETUP.1 / SamplesForm1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-10-02  |  8.0 KB  |  259 lines

  1. VERSION 5.00
  2. Object = "{C22877C0-4214-11D0-B0DA-080009C351D7}#1.0#0"; "FtpTree.ocx"
  3. Begin VB.Form Form1 
  4.    Caption         =   "FtpTree ActiveX Control VB Sample"
  5.    ClientHeight    =   6810
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   7935
  9.    Icon            =   "SamplesForm1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6810
  12.    ScaleWidth      =   7935
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.CommandButton FindFiles 
  15.       Caption         =   "&Find Files..."
  16.       Height          =   375
  17.       Left            =   5880
  18.       TabIndex        =   15
  19.       Top             =   5880
  20.       Width           =   1575
  21.    End
  22.    Begin VB.CommandButton CompareFolders 
  23.       Caption         =   "Synchronize..."
  24.       Height          =   375
  25.       Left            =   5880
  26.       TabIndex        =   14
  27.       Top             =   5400
  28.       Width           =   1575
  29.    End
  30.    Begin VB.CommandButton NewDir 
  31.       Caption         =   "&New Folder..."
  32.       Height          =   375
  33.       Left            =   5880
  34.       TabIndex        =   13
  35.       Top             =   4920
  36.       Width           =   1575
  37.    End
  38.    Begin VB.CommandButton Remove 
  39.       Caption         =   "&Remove"
  40.       Height          =   375
  41.       Left            =   5880
  42.       TabIndex        =   11
  43.       Top             =   4440
  44.       Width           =   1575
  45.    End
  46.    Begin VB.CommandButton Open 
  47.       Caption         =   "&Open"
  48.       Height          =   375
  49.       Left            =   5880
  50.       TabIndex        =   10
  51.       Top             =   3960
  52.       Width           =   1575
  53.    End
  54.    Begin VB.CommandButton View 
  55.       Caption         =   "&View"
  56.       Height          =   375
  57.       Left            =   5880
  58.       TabIndex        =   9
  59.       Top             =   3480
  60.       Width           =   1575
  61.    End
  62.    Begin VB.CommandButton Get 
  63.       Caption         =   "&Get"
  64.       Height          =   375
  65.       Left            =   5880
  66.       TabIndex        =   8
  67.       Top             =   3000
  68.       Width           =   1575
  69.    End
  70.    Begin VB.TextBox Password 
  71.       Height          =   375
  72.       IMEMode         =   3  'DISABLE
  73.       Left            =   5880
  74.       PasswordChar    =   "*"
  75.       TabIndex        =   3
  76.       Text            =   "sales@rhinosoft.com"
  77.       Top             =   1920
  78.       Width           =   1815
  79.    End
  80.    Begin VB.TextBox UserID 
  81.       Height          =   405
  82.       Left            =   5880
  83.       TabIndex        =   2
  84.       Text            =   "anonymous"
  85.       Top             =   1200
  86.       Width           =   1815
  87.    End
  88.    Begin VB.TextBox Site 
  89.       Height          =   375
  90.       Left            =   5880
  91.       TabIndex        =   1
  92.       Text            =   "ftp.microsoft.com"
  93.       Top             =   480
  94.       Width           =   1815
  95.    End
  96.    Begin VB.CommandButton Connect 
  97.       Caption         =   "&Connect"
  98.       Height          =   375
  99.       Left            =   5880
  100.       TabIndex        =   7
  101.       Top             =   2520
  102.       Width           =   1575
  103.    End
  104.    Begin VB.Frame Frame1 
  105.       Caption         =   "FTP Site"
  106.       Height          =   6495
  107.       Left            =   120
  108.       TabIndex        =   0
  109.       Top             =   120
  110.       Width           =   5535
  111.       Begin FTPTREELib.FtpTree FtpTree1 
  112.          Height          =   5895
  113.          Left            =   240
  114.          TabIndex        =   12
  115.          Top             =   360
  116.          Width           =   5055
  117.          _Version        =   65536
  118.          _ExtentX        =   8916
  119.          _ExtentY        =   10398
  120.          _StockProps     =   228
  121.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  122.             Name            =   "MS Sans Serif"
  123.             Size            =   8.25
  124.             Charset         =   0
  125.             Weight          =   400
  126.             Underline       =   0   'False
  127.             Italic          =   0   'False
  128.             Strikethrough   =   0   'False
  129.          EndProperty
  130.          BorderStyle     =   1
  131.          Appearance      =   1
  132.          TrackSelect     =   -1  'True
  133.          AllowPut        =   -1  'True
  134.          AllowRemove     =   -1  'True
  135.          AllowCreateDir  =   -1  'True
  136.          AllowRemoveDir  =   -1  'True
  137.          ShowFtpSite     =   -1  'True
  138.          AllowEditLables =   -1  'True
  139.          DodEntry        =   ""
  140.          DodUserID       =   ""
  141.          DodPassword     =   ""
  142.          DodDomain       =   ""
  143.          DodCallBackNumber=   ""
  144.       End
  145.    End
  146.    Begin VB.Label PasswordLabel 
  147.       Caption         =   "&Password:"
  148.       Height          =   255
  149.       Left            =   5880
  150.       TabIndex        =   6
  151.       Top             =   1680
  152.       Width           =   1815
  153.    End
  154.    Begin VB.Label Label1 
  155.       Caption         =   "&User ID:"
  156.       Height          =   255
  157.       Index           =   0
  158.       Left            =   5880
  159.       TabIndex        =   5
  160.       Top             =   960
  161.       Width           =   1695
  162.    End
  163.    Begin VB.Label SiteLabel1 
  164.       Caption         =   "&Site:"
  165.       Height          =   255
  166.       Index           =   1
  167.       Left            =   5880
  168.       TabIndex        =   4
  169.       Top             =   240
  170.       Width           =   1215
  171.    End
  172. Attribute VB_Name = "Form1"
  173. Attribute VB_GlobalNameSpace = False
  174. Attribute VB_Creatable = False
  175. Attribute VB_PredeclaredId = True
  176. Attribute VB_Exposed = False
  177. Private Sub CompareFolders_Click()
  178.     Dim Item As FtpTreeItem
  179.     Set Item = FtpTree1.GetSelectedItem
  180.     If Not Item Is Nothing Then
  181.         Item.RunSynchronizeFoldersDialog
  182.     End If
  183. End Sub
  184. Private Sub FindFiles_Click()
  185.     Dim Item As FtpTreeItem
  186.     Set Item = FtpTree1.GetSelectedItem
  187.     If Not Item Is Nothing Then
  188.         If (Item.IsDirectory) Then
  189.             Path = Item.Path
  190.         Else
  191.             Path = Item.Parent.Path
  192.         End If
  193.         
  194.         FtpTree1.RunFindFileDialog (Path)
  195.     End If
  196. End Sub
  197. Private Sub Form_Load()
  198.     Dim StrArr(1 To 10) As String
  199.     FtpTree1.AllowEditLabels = True
  200.     StrArr(1) = ".htm,C:\Program Files\Microsoft FrontPage\bin\fpeditor.exe"
  201.     FtpTree1.AlternateEditors = StrArr
  202.     FtpTree1.UploadNewerOnly = True
  203. End Sub
  204. Private Sub FtpTree1_DownloadRequest(ByVal DestDir As String, ByVal SourceFiles As Variant)
  205.     ' uncomment the following line to cancel the request
  206.     ' FtpTree1.Abort
  207. End Sub
  208. Private Sub FtpTree1_FileAdded(ByVal FtpTreeItem As FTPTREELib.FtpTreeItem)
  209.    MsgBox FtpTreeItem.filename
  210. End Sub
  211. Private Sub FtpTree1_UploadRequest(ByVal DestinationItem As FTPTREELib.FtpTreeItem, ByVal SourceFiles As Variant)
  212.     ' uncomment the following line to cancel the request
  213.     ' FtpTree1.Abort
  214. End Sub
  215. Private Sub Get_Click()
  216.     Dim Item As FtpTreeItem
  217.     Set Item = FtpTree1.GetSelectedItem
  218.     If Not Item Is Nothing Then
  219.         Item.Get
  220.     End If
  221. End Sub
  222. Private Sub Connect_Click()
  223.     FtpTree1.ShowFtpSite = True
  224.     FtpTree1.NewSession Site, "", UserID, Password
  225. End Sub
  226. Private Sub NewDir_Click()
  227.     ' make sure we have an item selected first
  228.     If Not Form1.FtpTree1.SelItem Is Nothing Then
  229.         
  230.         ' do the NewFolder dialog
  231.         NewFolder.Show
  232.     Else
  233.         MsgBox "Please select a parent folder before using this option.", , "FtpTree ActiveX Control VB Sample"
  234.     End If
  235. End Sub
  236. Private Sub Open_Click()
  237.     Dim Item As FtpTreeItem
  238.     Set Item = FtpTree1.GetSelectedItem
  239.     If Not Item Is Nothing Then
  240.         Item.Open
  241.     End If
  242. End Sub
  243. Private Sub Remove_Click()
  244.     Dim Item As FtpTreeItem
  245.     Set Item = FtpTree1.GetSelectedItem
  246.     If Not Item Is Nothing Then
  247.         If MsgBox("Are you sure you want to remove: " + Item.filename, vbYesNo, "FtpTree Sample") = vbYes Then
  248.             Item.Delete
  249.         End If
  250.     End If
  251. End Sub
  252. Private Sub View_Click()
  253.     Dim Item As FtpTreeItem
  254.     Set Item = FtpTree1.GetSelectedItem
  255.     If Not Item Is Nothing Then
  256.         Item.View
  257.     End If
  258. End Sub
  259.